Skip to content

Conversation

@Hiroshiba
Copy link
Member

内容

chore: venderダウンロード時、retryFetchでエラーになったときもリトライするように変更

関連 Issue

スクリーンショット・動画など

その他

@Hiroshiba Hiroshiba requested a review from a team as a code owner March 15, 2025 16:55
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Mar 15, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:ea9ec2e

@Hiroshiba Hiroshiba requested a review from Copilot March 16, 2025 05:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the retry mechanism during vendor downloads by ensuring that errors thrown during fetch requests are caught and logged, so that the operation can be retried.

  • Added a try-catch around the fetch call in the retry loop
  • Modified error logging for fetch failures
Comments suppressed due to low confidence (1)

tools/helper.mts:23

  • The final fetch call is not wrapped in a try-catch block, which might lead to unhandled errors if the request fails. Consider wrapping it in a try block to maintain consistent error handling throughout the function.
return fetch(url, options);

@Hiroshiba Hiroshiba requested a review from Copilot March 16, 2025 05:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the retryFetch function to ensure that a network error or a non-OK response from fetch leads to a retry attempt.

  • The for loop is modified to iterate one additional time by changing the loop condition.
  • A try/catch block is added to handle errors from fetch and log them properly.
Comments suppressed due to low confidence (1)

tools/helper.mts:11

  • With the current change, the loop attempts fetch 'retries' times and then calls fetch one additional time after the loop, resulting in a total of retries+1 attempts. Consider adjusting the logic to ensure the total number of attempts matches the intended retry count.
for (let i = 0; i < retries; i++) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants